<?php

/**
 * Description of Question
 *
 * @author hoangle
 */
class QuestionCate {

    private $db;
    
    public function  __construct() {
        $this->db = Zend_Registry::get('db');
    }

    /**
     * @desc Get list user question by userid
     * @param <type> $userid
     * @return <array> data user question
     */
    public function getQuestionCate() {
        try {
            $sql = "SELECT id,cate_name,cate_up_level FROM category as c, question_cate as q
                WHERE c.id=q.cate_id ";
            $stmt = $this->db->prepare($sql);
            $stmt->execute();
            $result = $stmt->fetchAll();
            $stmt->closeCursor();
            unset($stmt);
        }
        catch (Zend_Db_Exception $e) {
            throw new Zend_Exception($e->getMessage(), 11);
        }
        return $result;
    }
    
}

?>
